<?php
session_start();
require("../bin/common.php");
checkSess();
checkInstall();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Generate Neoncube.ini - Vanadium Patch Mananger</title>
<link href="../lib/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../lib/script.js"></script>
<script type="text/javascript">
function checkField() {
	var count = 0;
	if (document.getElementById("svr_name").value == "") {
		alert("You must put in your Server's Name.");
		count++;
	}
	if (document.getElementById("exec").value == "") {
		alert("You must type the name of your executable file.");
		count++;
	}
	if (count == 0) {
		return true;
	}
	else {
		return false;
	}
}

if (document.layers) { // Netscape
    document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove = captureMousePosition;
} else if (document.all) { // Internet Explorer
    document.onmousemove = captureMousePosition;
} else if (document.getElementById) { // Netcsape 6
    document.onmousemove = captureMousePosition;
}
// Global variables
xMousePos = 0; // Horizontal position of the mouse on the screen
yMousePos = 0; // Vertical position of the mouse on the screen
xMousePosMax = 0; // Width of the page
yMousePosMax = 0; // Height of the page

function captureMousePosition(e) {
    if (document.layers) {
        // When the page scrolls in Netscape, the event's mouse position
        // reflects the absolute position on the screen. innerHight/Width
        // is the position from the top/left of the screen that the user is
        // looking at. pageX/YOffset is the amount that the user has 
        // scrolled into the page. So the values will be in relation to
        // each other as the total offsets into the page, no matter if
        // the user has scrolled or not.
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    } else if (document.all) {
        // When the page scrolls in IE, the event's mouse position 
        // reflects the position from the top/left of the screen the 
        // user is looking at. scrollLeft/Top is the amount the user
        // has scrolled into the page. clientWidth/Height is the height/
        // width of the current page the user is looking at. So, to be
        // consistent with Netscape (above), add the scroll offsets to
        // both so we end up with an absolute value on the page, no 
        // matter if the user has scrolled or not.
        xMousePos = window.event.x+document.body.scrollLeft;
        yMousePos = window.event.y+document.body.scrollTop;
        xMousePosMax = document.body.clientWidth+document.body.scrollLeft;
        yMousePosMax = document.body.clientHeight+document.body.scrollTop;
    } else if (document.getElementById) {
        // Netscape 6 behaves the same as Netscape 4 in this regard 
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    }
}

function dispHelp(x) {
	var helpDiv = document.getElementById('help');
	helpDiv.style.visibility = "visible";
	helpDiv.style.left = xMousePos + "px";
	helpDiv.style.top = yMousePos + "px";
	
	var helpContent;
	switch(x) {
		case "svr_name":
			helpContent = "The server name is your current servers name<br />For example: <b>Example RO</b>";
		break;
		
		case "exec":
			helpContent = "The name of your servers executable file (your client).<br />For example: <b>ExampleRO.exe</b>";
		break;
		
		case "register":
			helpContent = "The registration link of your server (without http://).<br />For example: <b>www.example.com/register.php</b><br /><br />The default registration link is your website's main URL.";
		break;
		
		case "skin":
			helpContent = "The name of the patchers skin that is in use.The default is <b>skin_default</b>";
		break;
		
		case "grf":
			helpContent = "Your server's GRF file.<br />The default is updates.grf";
		break;
	}
	
	helpDiv.innerHTML = helpContent;
}

function remHelp(x) {
	document.getElementById('help').style.visibility = "hidden";
}
</script>
</head>
<body onload="fixSize()" onresize="fixSize()">

<div class="container" id="container">

	<!-- Header -->
	<div class="top">
	Vanadium Patch Manager

	<?php
	dispLogin();
	?>
	</div>
    
	<!-- Left Hand Panel -->
	<div class="left">
		<br /><span class="nav_option"><img src="../lib/gfx/icon_home.gif" width="15" height="15" alt="Home" /> <a href="../home/">Home</a></span><br /><br />
		<span class="nav_tab_option"><img src="../lib/gfx/icon_add.gif" width="12" height="12" alt="Add" /> <a href="../addpatch/">Add Patch</a></span><br /><br />
		<span class="nav_tab_option"><img src="../lib/gfx/icon_edit.gif" width="13" height="16" alt="Edit" /> <a href="../patch/changelog.php">View Changelog</a></span><br /><br />
		<span class="nav_tab_option"><img src="../lib/gfx/icon_edit.gif" width="13" height="16" alt="Edit" /> <a href="../editpatch/">Edit Patch Home</a></span><br /><br />
		<span class="nav_tab_option"><img src="../lib/gfx/icon_setup.gif" width="14" height="16" alt="Setup" /> <a href="../setup/">Setup</a></span><br /><br />
        <span class="nav_tab_tab_option"><img src="../lib/gfx/icon_edit.gif" width="13" height="16" alt="Edit" /> <a href="../setup/neoncube.php">Neoncube.ini</a></span><br /><br />
        <span class="nav_tab_tab_option"><img src="../lib/gfx/icon_account.gif" width="14" height="14" alt="Accounts" /> <a href="../setup/accounts.php">Accounts</a></span><br /><br />
        <span class="nav_tab_tab_option"><img src="../lib/gfx/icon_cp.gif" width="16" height="16" alt="Control Panel" /> <a href="../setup/cpanel.php">Control Panel</a></span>
	</div>
    
	<!-- Body Content Container -->
	<div class="content_container" id="content_container">
    
		<!--Content Title -->
		<div class="content_title">
			Setup - Generate Neoncube.ini
		</div>
        
		<!--Content Body -->
		<div class="content_body">
			Now, before we can generate your neoncube.ini we need to know a few details. If you are unable to answer any questions please leave it blank, the questions with an asterix at the end are mandatory.<br /><br />
            Please fill out the data in the respective fields below:<br /><br />
            <form method="post" action="generate.php" onsubmit="return checkField();">
            Server Name:<font style="color:#F00;">*</font> <img src="../lib/gfx/icon_help.gif" width="16" height="16" alt="Help" onmouseover="dispHelp('svr_name');" onmouseout="remHelp('svr_name');" /><br /><input type="text" name="svr_name" id="svr_name" style="color: #0a0a0a" /><br /><br />
            Executable File:<font style="color:#F00;">*</font> <img src="../lib/gfx/icon_help.gif" width="16" height="16" alt="Help" onmouseover="dispHelp('exec');" onmouseout="remHelp('exec');" /><br /><input type="text" name="exec" id="exec" style="color: #0a0a0a" /><br /><br />
            Registration Link (no http://): <img src="../lib/gfx/icon_help.gif" width="16" height="16" alt="Help" onmouseover="dispHelp('register');" onmouseout="remHelp('register');" /><br /><input type="text" name="registration" style="color: #0a0a0a" /><br /><br />
            Skin in Use: <img src="../lib/gfx/icon_help.gif" width="16" height="16" alt="Help" onmouseover="dispHelp('skin');" onmouseout="remHelp('skin');" /><br /><input type="text" name="skin" style="color: #0a0a0a" /><br /><br />
            GRF File: <img src="../lib/gfx/icon_help.gif" width="16" height="16" alt="Help" onmouseover="dispHelp('grf');" onmouseout="remHelp('grf');" /><br /><input type="text" name="grf" style="color: #0a0a0a" /><br /><br />
            <input type="submit" value="Generate" style="color:#0a0a0a" />
            </form>
            
            <div id="help" class="help"></div>
            </div>
    
	<!--End Content Container-->
	</div>
    
	<!--Footer -->
	<div class="footer">
		Vanadium Patch Manager, A Neoncube Patch Modification.<br />
		GNU General Public License v3 - 2010<br />
		http://code.google.com/p/vanadiumpatch/
	</div>

<!--End Container-->
</div>
</body>
</html>